import java.util.*;
public class Lab10Task05 {
public static void main(String[] args) {
Scanner kb = new Scanner(System.in);
int v;
int[]x=new int[10];
System.out.println("Enter 10 integer values:");
for(int i=0;i<10;i++) {
x[i]=kb.nextInt();
}
System.out.print("Enter an integer value: ");
v=kb.nextInt();
int[]largerElements=largerElements(x,v);
if(largerElements.length>1) {
System.out.printf("The array elements larger than %d are: ",v);
for(int i=0;i<largerElements.length;i++) {
System.out.print(largerElements[i]+"  ");
}
}
else if(largerElements.length==1)
System.out.printf("The array element larger than %d is: ",v,largerElements[0]);
else
System.out.printf("There are no array element larger than %d",v);
kb.close();
}
public static int[] largerElements(int[]x,int v) {
int count=0,j=0;
for(int i=0;i<10;i++) {
if(x[i]>v)
count++;
}
int[]largerElements=new int[count];
for(int i=0;i<10;i++) {
if(x[i]>v) {
largerElements[j]=x[i];
j++;
}
}
return largerElements;
}
}
